<template>
  <div class="poster">
    <h3>上传海报</h3>
    <van-uploader
      v-model="fileList"
      :after-read="afterRead"
      accept="video/*,image/*"
    >
      <van-button icon="plus" type="primary">上传文件</van-button>
    </van-uploader>

    <span class="el-upload__tip" style="margin-left: 10px"
      >格式支持 MP4，文件大小不超过 10MB</span
    >
    <van-divider />
    <van-field v-model="text" label="文件名"></van-field>

    <van-button type="primary">提交</van-button>
  </div>
</template>

<script>
import { showToast } from 'vant';
import 'vant/es/toast/style';
import { ref } from 'vue';

export default {
  setup() {
    const fileList = ref([]);
    const afterRead = (file) => {
      console.log(file);
    };
    return {
      fileList,
      afterRead,
    };
  },
};
</script>

<style lang="less">
.goods {
  padding-bottom: 50px;

  &-swipe {
    img {
      width: 100%;
      display: block;
    }
  }

  &-title {
    font-size: 16px;
  }

  &-price {
    color: #f44;
  }

  &-express {
    color: #999;
    font-size: 12px;
    padding: 5px 15px;
  }

  &-cell-group {
    margin: 15px 0;

    .van-cell__value {
      color: #999;
    }
  }

  &-tag {
    margin-left: 5px;
  }
}
</style>
